package com.amt.basic.controller;

import com.amt.basic.service.TestService;
import com.amt.configure.ControllerLog;
import com.amt.configure.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@Api(tags = "test接口")
@RestController
@RequestMapping("test")
public class TestController {
    @Autowired
    private TestService testService;

    @ApiOperation(value = "获取令牌", notes = "获取令牌。")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功", response = ResultMsg.class),
            @ApiResponse(code = 201, message = "查询失败", response = ResultMsg.class)})
    @PostMapping("/getToken")
    @ControllerLog("获取令牌")
    public String getToken() {
        return testService.getToken();
    }
}
